def file_info(file_name):
    f = None
    try:
        f = open(file_name, "r", encoding="UTF-8")
        content = f.read()
        print(f"读取的文件内容是：{content}")
    except Exception as e:
        print(f"出现异常了，异常内容是：{e}")
    finally:
        if f:
            f.close()

if __name__ == '__main__':
    file_name = "E:/excel学习文档-表格/bil.txt"

# def add_info(file_name,data):
#     f = open(file_name,"w",encoding = "UTF-8")
#     f.write(data)
#     f.write("\n")
#     f.close()
# if __name__ == '__main__':
#     add_info("E:/excel学习文档-表格/111.txt","jiayyy")

